/*****************
SETUP
*****************/

clear
log close _all

cd "Path\to\file"

use CIR_2018.dta


/*********
CLEANING
********/

*Missing Values

	foreach x of varlist cirawareselected cirawareproadvocates ///
	cirawareconadvocates cirawareexperts cirawareprocess cirawaredays ///
	truefalse1 truefalse2 truefalse3 truefalse4 ///
	truefalse5 truefalse6 understand {
	
	replace `x' = 0 if `x' == -97
	
	}
	
replace tfaccuracy1 = truefalse1	

	ds truefalse1 truefalse2 truefalse3 truefalse4 ///
	truefalse5 truefalse6 tfaccuracy1 tfaccuracy2 tfaccuracy3 ///
	tfaccuracy4 tfaccuracy5 tfaccuracy6 cirawareselected ///
	cirawareproadvocates cirawareconadvocates cirawareexperts ///
	cirawareprocess cirawaredays partyidlean makediff legvscit voteallpost ///
	knowledgeaccuracy, not

	foreach x of varlist `r(varlist)' {
	
	capture noisily replace `x' = . if `x' < 0
	
	}
	

	
/*********
GENERATING VARIABLES
********/

*Creating a Race and Ethnicity Variable

gen race = .

replace race = 1 if ethnicity_white == 1 & ethnicity_native_ind ~= 1 & ///
ethnicity_asianamerican ~= 1 & ethnicity_africamerican ~= 1 & ///
ethnicity_hispaniclatino ~= 1 & ethnicity_native_pacificisland ~= 1 & ///
ethnicity_other ~= 1

replace race = 2 if ethnicity_africamerican == 1 & ethnicity_native_ind ~= 1 & ///
ethnicity_asianamerican ~= 1 & ethnicity_white ~= 1 & ///
ethnicity_hispaniclatino ~= 1 & ethnicity_native_pacificisland ~= 1 & ///
ethnicity_other ~= 1

replace race = 3 if ethnicity_hispaniclatino == 1 & ethnicity_native_ind ~= 1 & ///
ethnicity_asianamerican ~= 1 & ethnicity_africamerican ~= 1 & ///
ethnicity_white ~= 1 & ethnicity_native_pacificisland ~= 1 & ///
ethnicity_other ~= 1

replace race = 4 if ethnicity_asianamerican == 1 & ethnicity_native_ind ~= 1 & ///
ethnicity_white ~= 1 & ethnicity_africamerican ~= 1 & ///
ethnicity_hispaniclatino ~= 1 & ethnicity_native_pacificisland ~= 1 & ///
ethnicity_other ~= 1

replace race = 5 if ethnicity_white ~= 1 & ethnicity_asianamerican ~= 1 ///
& ethnicity_africamerican ~= 1 & ethnicity_hispaniclatino ~= 1 ///
& (ethnicity_native_pacificisland == 1 | ethnicity_native_ind == 1 | ///
ethnicity_other == 1)

replace race = 6 if (ethnicity_white == 1 & (ethnicity_afr == 1 | ///
ethnicity_asianamerican == 1 | ethnicity_hisp == 1 & ///
ethnicity_native_ind == 1 & ethnicity_native_pacificisland == 1 & ///
ethnicity_other == 1))

replace race = 6 if (ethnicity_afr == 1 & (ethnicity_white == 1 | ///
ethnicity_asianamerican == 1 | ethnicity_hisp == 1 & ///
ethnicity_native_ind == 1 & ethnicity_native_pacificisland == 1 & ///
ethnicity_other == 1))

replace race = 6 if (ethnicity_asi == 1 & (ethnicity_white == 1 | ///
ethnicity_afr == 1 | ethnicity_hisp == 1 & ///
ethnicity_native_ind == 1 & ethnicity_native_pacificisland == 1 & ///
ethnicity_other == 1))

replace race = 6 if (ethnicity_hisp == 1 & (ethnicity_white == 1 | ///
ethnicity_asianamerican == 1 | ethnicity_afr == 1 & ///
ethnicity_native_ind == 1 & ethnicity_native_pacificisland == 1 & ///
ethnicity_other == 1))

replace race = 6 if (ethnicity_native_ind == 1 & (ethnicity_white == 1 | ///
ethnicity_asianamerican == 1 | ethnicity_afr == 1 & ///
ethnicity_hisp == 1 & ethnicity_native_pacificisland == 1 & ///
ethnicity_other == 1))

replace race = 6 if (ethnicity_native_pac == 1 & (ethnicity_white == 1 | ///
ethnicity_asianamerican == 1 | ethnicity_afr == 1 & ///
ethnicity_hisp == 1 & ethnicity_native_ind == 1 & ///
ethnicity_other == 1))

replace race = 6 if (ethnicity_other == 1 & (ethnicity_white == 1 | ///
ethnicity_asianamerican == 1 | ethnicity_afr == 1 & ///
ethnicity_hisp == 1 & ethnicity_native_ind == 1 & ///
ethnicity_native_pac == 1))

lab def race 1 "White" 2 "Black" 3 "Hispanic" 4 "Asian" 5 "Other" 6 "Mixed"
lab val race race


*State Categorical Variable

gen state_num = .
replace state_num = 1 if state == "California"
replace state_num = 2 if state == "Massachusetts"
replace state_num = 3 if state == "Oregon"

lab def state 1 "California" 2 "Massachussetts" 3 "Oregon"
lab val state_num state


*PartyID with Leaners

gen partyID3 = .
replace partyID3 = 1 if partyid == 1 | partyidlean == -1
replace partyID3 = 2 if partyidlean == 0
replace partyID3 = 3 if partyidlean == 1 | partyid == 2

lab def pid3 1 "Democrat" 2 "True Neutral" 3 "Republican"
lab val partyID3 pid3


*Treatment Variables

gen exposure = .
replace exposure = 1 if shownguide == "Yes" & showncir == "No"
replace exposure = 2 if shownguide == "No" & showncir == "Yes"
replace exposure = 3 if shownguide == "No" & showncir == "No"
replace exposure = 4 if shownguide == "Yes" & showncir == "Yes"

*Shown guide VS. Shown ONLY CIR
gen treatment = .
replace treatment = 0 if exposure == 1
replace treatment = 1 if exposure == 2


*Show guide VS Shown CIR and Guide
gen treatment2 = .
replace treatment2 = 0 if exposure == 1
replace treatment2 = 1 if exposure == 4 


lab def expose 1 "Only Guide" 2 "Only CIR" 3 "Neither" 4 "Both"
lab def treat 0 "Only Guide" 1 "Only CIR"
lab def treat2 0 "Only Guide" 1 "CIR+Guide"

lab val treatment treat
lab val treatment2 treat2
lab val exposure expose

*Treatment Type

gen treat_type = .
replace treat_type = 1 if shownguide == "Yes" & showncir == "No"
replace treat_type = 2 if shownguide == "No" & showncir == "Yes"
replace treat_type = 3 if shownguide == "Yes" & showncir == "Yes"

lab def treat_type 1 "Only Guide" 2 "Only CIR" 3 "Guide & CIR"
lab val treat_type treat_type


*Scale variables for Minipublic Legitimacy/Trust

alpha minipublic1 minipublic2 minipublic3 minipublic4 minipublic5 ///
minipublic6 minipublic7 minipublic8, gen(minipublic_trust)

sum minipublic_trust
replace minipublic_trust = (minipublic_trust - `r(min)') / (`r(max)'-`r(min)')

lab var minipublic_trust "Minipublic Legitimacy"


*Description of CIR treatment variables: Generating a numerical variable.

gen randomselection = .
replace randomselection = 1 if cirrandomselection == "The twenty citizen panelists who conducted this Review were randomly selected from the California registered voter list. A neutral nonprofit used a scientific sampling method to ensure that the Review panel was representative of the overall electorate bas"

replace randomselection = 0 if cirrandomselection == "Twenty registered California voters were chosen as panelists."


gen duration = .
replace duration = 1 if cirduration == "The panel met to discuss Proposition 10 over four consecutive days using a well-tested discussion procedure and professional facilitators. Panelists received training in critical thinking and reflective listening to ensure high-quality deliberation throug"

replace duration = 0 if cirduration == "The panel was convened to study Proposition 10."


gen experts = . 
replace experts = 0 if cirexperts == "Also, the panel obtained relevant policy information."

replace experts = 1 if cirexperts == "Independent policy experts answered questions from the Review panelists. This helped the citizen panelists understand important details in Proposition 10 and the effects that similar legislation has had in other states."


gen partisans = . 
replace partisans = 0 if cirpartisans == "The Review panel considered why people might vote for or against Proposition 10."

replace partisans = 1 if cirpartisans == "The Review panel had the opportunity to hear arguments from advocates and opponents of Proposition 10. Panelists were able to ask follow-up questions and had enough time to consider carefully the arguments made on both sides of the issue."


lab def expose2 0 "Limited Description" 1 "Full Description"
lab val randomselection experts partisans duration expose2


*Dummy variables

gen educ_dum = .
replace educ_dum = 0 if educ < 5
replace educ_dum = 1 if educ > 4 & educ ~= .

gen age_dum = .
replace age_dum = 0 if age < 53
replace age_dum = 1 if age > 52 & age ~= .

gen race_dum = .
replace race_dum = 0 if race == 1
replace race_dum = 1 if race > 1 & race ~= .

lab def race_dum 0 "White" 1 "People of Color"
lab val race_dum race_dum
lab var race_dum "White/People of Color"

gen inc_dum = .
replace inc_dum = 0 if income < 5
replace inc_dum = 1 if income > 4 & income ~= .

gen party_dum = .
replace party_dum = 0 if partyid == 1
replace party_dum = 1 if partyid == 2

lab var party_dum "Liberal/Conservative"


*Labeling

lab var income "Income (7 levels)"
lab var educ "Education (9 levels)"
lab var female "Female/Male"


*Standardized Version of True/False Index and Voting variables for each state

egen tf_all = rowmean(tfaccuracy1 tfaccuracy2 tfaccuracy3 tfaccuracy4 ///
tfaccuracy5 tfaccuracy6)

replace tf_all = (tf_all - .414) / .560 if state_num == 1
replace tf_all = (tf_all - .387) / .440 if state_num == 2
replace tf_all = (tf_all - .528) / .449 if state_num == 3

lab var tf_all "Policy Knowledge"



*Recoding Voting variable to run from -1 NO to +1 YES with 0 UNDECIDED

recode votepost (1=-1) (2=0)
recode votepost (3=1)

lab def vote -1 "No" 0 "Undecided" 1 "Yes"
lab val votepost vote


/*****************
END OF SETUP
*****************/


*Drop Respondents in the Selection Condition
drop if offeredinfochoices=="Yes"

cls

log using cir2018.log, replace



/***********
STUDY 1: Describing minipublic trust/legitimacy
***********/	


	foreach x of varlist minipublic1 minipublic2 minipublic3 minipublic4 ///
	minipublic5 minipublic6 minipublic7 minipublic8 {
	
	tab `x' if exposure == 3 | exposure == 1
		
	}
	
	
***Online Appendix B***


	foreach x of varlist educ female age race_dum party_dum income {
		
	disp "`x'"	
	reg minipublic_trust `x', hc3 beta
	esttab using m4.rtf, append se label nonumber nobaselevels	
	
	}


reg minipublic_trust age race_dum educ female income party_dum, hc3 beta
esttab using m4.rtf, append se label nonumber nobaselevels


mrobust reg minipublic_trust age race educ female income party_dum, ///
vce(robust) noplot

mrobust reg minipublic_trust race_dum age educ female income party_dum, ///
vce(robust) noplot

mrobust reg minipublic_trust educ age race female income party_dum, ///
vce(robust) noplot

mrobust reg minipublic_trust female age race educ income party_dum, ///
vce(robust) noplot

mrobust reg minipublic_trust income age race educ female party_dum, ///
vce(robust) noplot

mrobust reg minipublic_trust party_dum age race educ female income, ///
vce(robust) noplot

	
	
/***********
STUDY 3: Effect heterogeneity
***********/
	

***Table 2: Effects of CIR Statement on Vote Choice and Policy Knowledge***

	ttest tf_all if state_num == 1, by(treatment) welch
	esize twosample tf_all if state_num == 1, by(treatment) ///
	cohensd hedgesg glassdelta
	
	ttest tf_all if state_num == 3, by(treatment) 
	esize twosample tf_all if state_num == 3, by(treatment) ///
	cohensd hedgesg glassdelta
	
	ttest tf_all if state_num == 2, by(treatment2) 
	esize twosample tf_all if state_num == 2, by(treatment2) ///
	cohensd hedgesg glassdelta
	
	ttest tf_all if state_num == 3, by(treatment2)
	esize twosample tf_all if state_num == 3, by(treatment2) ///
	cohensd hedgesg glassdelta
		
	ttest votepost if state_num == 1, by(treatment) welch
	esize twosample votepost if state_num == 1, by(treatment) ///
	cohensd hedgesg glassdelta
		
	ttest votepost if state_num == 3, by(treatment)
	esize twosample votepost if state_num == 3, by(treatment) ///
	cohensd hedgesg glassdelta
	
	ttest votepost if state_num == 2, by(treatment2)
	esize twosample votepost if state_num == 2, by(treatment2) ///
	cohensd hedgesg glassdelta
		
	ttest votepost if state_num == 3, by(treatment2)
	esize twosample votepost if state_num == 3, by(treatment2) ///
	cohensd hedgesg glassdelta
	

anova votepost treat_type if state_num == 3
anova tf_all treat_type if state_num == 3


***Table 3: Difference Across Levels of Minipublic Legitimacy***	

oprobit votepost i.treatment if state_num==3, robust
oprobit votepost c.minipublic_trust i.treatment if state_num==3, robust

reg tf_all i.treatment if state_num==3, hc3 beta
reg tf_all c.minipublic_trust i.treatment if state_num==3, hc3 beta

oprobit votepost i.treatment2 if state_num==2, robust
oprobit votepost c.minipublic_trust i.treatment2 if state_num==2, robust

reg tf_all i.treatment2 if state_num==2, hc3 beta
reg tf_all c.minipublic_trust i.treatment2 if state_num==2, hc3 beta

oprobit votepost i.treatment2 if state_num==3, robust 
oprobit votepost c.minipublic_trust i.treatment2 if state_num==3, robust 

reg tf_all i.treatment2 if state_num==3, hc3 beta
reg tf_all c.minipublic_trust i.treatment2 if state_num==3, hc3 beta




***Online Appendix E: Tables E1-E47***

oprobit votepost ib3.partyID3##i.treatment if state_num==1, robust
esttab using m1.rtf, replace se label nonumber nobaselevels noconstant ///
title("Table A1: Party Identification")

oprobit votepost i.female##i.treatment if state_num==1, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A2: Gender")

oprobit votepost i.race_dum##i.treatment if state_num==1, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A3: Race")

oprobit votepost c.income##i.treatment if state_num==1, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A4: Income")

oprobit votepost c.educ##i.treatment if state_num==1, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A5: Education")

oprobit votepost c.age##i.treatment if state_num==1, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A6: Age")

oprobit votepost ib3.partyID3##i.treatment if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A7: Party Identification")

oprobit votepost i.female##i.treatment if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A8: Gender")

oprobit votepost i.race_dum##i.treatment if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A9: Race")

oprobit votepost c.income##i.treatment if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A10: Income")

oprobit votepost c.educ##i.treatment if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A11: Education")

oprobit votepost c.age##i.treatment if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A12: Age")

oprobit votepost ib3.partyID3##i.treatment2 if state_num==2, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A13: Party Identification")

oprobit votepost i.female##i.treatment2 if state_num==2, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A14: Gender")

oprobit votepost i.race_dum##i.treatment2 if state_num==2, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A15: Race")

oprobit votepost c.income##i.treatment2 if state_num==2, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A16: Income")

oprobit votepost c.educ##i.treatment2 if state_num==2, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A17: Education")

oprobit votepost c.age##i.treatment2 if state_num==2, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A18: Age")

oprobit votepost ib3.partyID3##i.treatment2 if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A19: Party Identification")

oprobit votepost i.female##i.treatment2 if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A20: Gender")

oprobit votepost i.race_dum##i.treatment2 if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A21: Race")

oprobit votepost c.income##i.treatment2 if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A22: Income")

oprobit votepost c.educ##i.treatment2 if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A23: Education")

oprobit votepost c.age##i.treatment2 if state_num==3, robust
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A24: Age")

reg tf_all ib3.partyID3##i.treatment if state_num==1, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A25: Party Identification")

reg tf_all i.female##i.treatment if state_num==1, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A26: Gender")

reg tf_all i.race_dum##i.treatment if state_num==1, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A27: Race")

reg tf_all c.income##i.treatment if state_num==1, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A28: Income")

reg tf_all c.educ##i.treatment if state_num==1, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A29: Education")

reg tf_all c.age##i.treatment if state_num==1, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A30: Age")

reg tf_all ib3.partyID3##i.treatment if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A31: Party Identification")

reg tf_all i.female##i.treatment if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A32: Gender")

reg tf_all i.race_dum##i.treatment if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A33: Race")

reg tf_all c.income##i.treatment if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A34: Income")

reg tf_all c.educ##i.treatment if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A35: Education")

reg tf_all c.age##i.treatment if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A36: Age")

reg tf_all ib3.partyID3##i.treatment2 if state_num==2, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A37: Party Identification")

reg tf_all i.female##i.treatment2 if state_num==2, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A38: Gender")

reg tf_all i.race_dum##i.treatment2 if state_num==2, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A39: Race")

reg tf_all c.income##i.treatment2 if state_num==2, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A40: Income")

reg tf_all c.educ##i.treatment2 if state_num==2, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A41: Education")

reg tf_all c.age##i.treatment2 if state_num==2, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A42: Age")

reg tf_all ib3.partyID3##i.treatment2 if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A43: Party Identification")

reg tf_all i.female##i.treatment2 if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A44: Gender")

reg tf_all i.race_dum##i.treatment2 if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A45: Race")

reg tf_all c.income##i.treatment2 if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A46: Income")

reg tf_all c.educ##i.treatment2 if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A47: Education")

reg tf_all c.age##i.treatment2 if state_num==3, hc3 beta
esttab using m1.rtf, append se label nonumber nobaselevels noconstant ///
title("Table A48: Age")


	
/***********
STUDY 2: Effect of minipublic description
***********/	

cls

drop if exposure == 1
keep if state_num == 1


/*
Table 1: Influence of CIR Description on Minipublic Legitimacy, Voting Choice, 
and Policy Knowledge
*/



	foreach x of varlist minipublic_trust tf_all  {
		
	reg `x' randomselection duration partisans experts, hc3	
		
		
	}


oprobit votepost randomselection duration partisans experts, robust	

	

***Online Appendix D: Tables D1-D3 ***

reg minipublic_trust randomselection duration partisans experts if ///
partyID3 == 3, hc3 beta	
esttab using App_D.rtf, replace se label nonumber nobaselevels	///
title("Table D1: Minipublic Trust - Republicans")
		
reg minipublic_trust randomselection duration partisans experts if ///
partyID3 == 1, hc3 beta	
esttab using App_D.rtf, append se label nonumber nobaselevels ///
title("Table D2: Minipublic Trust - Democrats")

reg minipublic_trust randomselection duration i.partisans##i.partyID3 ///
experts, hc3 beta	
esttab using App_D.rtf, append se label nonumber nobaselevels	///
title("Table D3: Minipublic Trust - Interaction Model")


/***********
FINISHING UP
***********/

log close


/***********
END OF DO-FILE
***********/